﻿<%@ Page Title="User Registration" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
    CodeBehind="Register.aspx.cs" Inherits="AmkeniCrossLoginApplication.Account.Register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    .style1
    {
        padding:0.5em 0 0.5em 0;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div style="margin:2px,2px,2px,2px;">
        <asp:SiteMapPath ID="SiteMapPath1" runat="server" ForeColor="#999999"></asp:SiteMapPath>
    </div>

    <asp:EntityDataSource ID="RolesDataSource" runat="server" 
        ConnectionString="name=Amkeni_DatabaseEntities" DefaultContainerName="Amkeni_DatabaseEntities" 
        EnableFlattening="False" EntitySetName="roles" 
        Select="it.[role1]">
    </asp:EntityDataSource>

    <asp:EntityDataSource ID="RegionDataSource" runat="server"
        ConnectionString="name=Amkeni_DatabaseEntities" DefaultContainerName="Amkeni_DatabaseEntities"
        EnableFlattening="False" EntitySetName="regions">
    </asp:EntityDataSource>

    <asp:EntityDataSource ID="ProjectDataSource" runat="server" 
        ConnectionString="name=Amkeni_DatabaseEntities" DefaultContainerName="Amkeni_DatabaseEntities" 
        EnableFlattening="False" EntitySetName="implementing_partner" 
        Select="it.[ip_id], it.[abbreviation]">
    </asp:EntityDataSource>

    <div style="text-align:center;">
    <div style="width:70%; margin-left:auto; margin-right:auto; text-align:left;">
    <asp:Table ID="Table1" runat="server">
        <asp:TableRow>
            <asp:TableCell Width="15em"  CssClass="style1">
                <asp:Label ID="Label1" runat="server" Text="First Name"></asp:Label>
            </asp:TableCell>
            <asp:TableCell Width="20em">
                <asp:TextBox ID="FirstNameTextBox" runat="server" Width="290px"></asp:TextBox>  
            </asp:TableCell>
            <asp:TableCell>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="*" ControlToValidate="FirstNameTextBox" ForeColor="Red"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1">
                <asp:Label ID="Label2" runat="server" Text="Last Name"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="LastNameTextBox" runat="server" Width="290px"></asp:TextBox>
            </asp:TableCell>
            <asp:TableCell>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="*" ControlToValidate="LastNameTextBox" ForeColor="Red"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1">
                <asp:Label ID="Label3" runat="server" Text="Email"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="EmailTextBox" runat="server" Width="290px"></asp:TextBox>
            </asp:TableCell>
            <asp:TableCell>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ErrorMessage="*" ControlToValidate="EmailTextBox" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ErrorMessage="Invalid email address" ControlToValidate="EmailTextBox" 
                    ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$" 
                    ForeColor="Red">
                </asp:RegularExpressionValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label9" runat="server" Text="Region (Programme Analyst)"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:ListBox ID="RegionListBox" runat="server" SelectionMode="Multiple" 
                    DataSourceID="RegionDataSource" DataTextField="name" DataValueField="region_id" 
                    Rows="6" Width="290px"></asp:ListBox>
            </asp:TableCell>
        </asp:TableRow>
        <%--<asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label12" runat="server" Text="Is Programme Manager?"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="IsProgrammeManager" runat="server">
                    <asp:ListItem Value="false" Text="NO"></asp:ListItem>
                    <asp:ListItem Value="true" Text="YES"></asp:ListItem>
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>--%>
        <asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label10" runat="server" Text="Implementing Partner"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:ListBox ID="ProjectListBox" runat="server" SelectionMode="Single" 
                    DataSourceID="ProjectDataSource" DataTextField="abbreviation" DataValueField="ip_id" 
                    Rows="6" Width="290px"></asp:ListBox>
            </asp:TableCell>
        </asp:TableRow>
        <%--<asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label11" runat="server" Text="Is Project Manager?"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="IsProjectManager" runat="server">
                    <asp:ListItem Value="false" Text="NO"></asp:ListItem>
                    <asp:ListItem Value="true" Text="YES"></asp:ListItem>
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>--%>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1">
                <asp:Label ID="Label4" runat="server" Text="Role"></asp:Label>
            </asp:TableCell>
            <asp:TableCell style="padding-top:5px;">
                <asp:ListBox ID="RolesListBox" runat="server" SelectionMode="Multiple" 
                    DataSourceID="RolesDataSource" DataTextField="role1" DataValueField="role1" 
                    Width="8em" Rows="3">
                </asp:ListBox>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1">
                <asp:Label ID="Label5" runat="server" Text="Password"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="PasswordTextBox1" runat="server" TextMode="Password" Width="290px"></asp:TextBox> 
            </asp:TableCell>
            <asp:TableCell>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage="*" ControlToValidate="PasswordTextBox1" ForeColor="Red"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1">
                <asp:Label ID="Label6" runat="server" Text="Repeat Password"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="PasswordTextBox2" runat="server" TextMode="Password" Width="290px"></asp:TextBox>
            </asp:TableCell>
            <asp:TableCell>
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ErrorMessage="Password does not match" ControlToValidate="PasswordTextBox1" 
                    ControlToCompare="PasswordTextBox2" ForeColor="Red"></asp:CompareValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label7" runat="server" Text="Is User Active?"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="ActiveList" runat="server">
                    <asp:ListItem Value="true" Text="YES"></asp:ListItem>
                    <asp:ListItem Value="false" Text="NO"></asp:ListItem>
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="style1">
                <asp:Label ID="Label11" runat="server" Text="Send Email Notifications to User?"></asp:Label>
            </asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="SendEmailNotificationList" runat="server">
                    <asp:ListItem Value="true" Text="YES"></asp:ListItem>
                    <asp:ListItem Value="false" Text="NO"></asp:ListItem>
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell  CssClass="style1"></asp:TableCell>
            <asp:TableCell>
                <% if (User.IsInRole("Administrator"))
                   { %>
                    <asp:Button ID="AddUserButton" runat="server" Text="Add User" OnClick="AddUserButton_Click" />
                <% } %>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
        <asp:Label ID="Label8" runat="server" Text="" Font-Size="Large" ForeColor="Red"></asp:Label>
    </div>
    </div>

</asp:Content>
